/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  19 Nov 2009 3:43:25 pm

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.12

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

//[Headers] You can add your own extra header files here...
//[/Headers]

#include "EdoControllerEditorWrapper.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
EdoControllerEditorWrapper::EdoControllerEditorWrapper (AudioProcessor *_edoController, EdoControllerEditor *_edoControllerEditor)
    : edoController(_edoController), AudioProcessorEditor(_edoController), edoControllerEditor(_edoControllerEditor),
      edoToolbar (0),
      midiKeyboardComponent (0)
{
    addAndMakeVisible (edoToolbar = new EdoToolbar());
    addAndMakeVisible (midiKeyboardComponent = new MidiKeyboardComponent (midiKeyboardComponentState, MidiKeyboardComponent::horizontalKeyboard));
    midiKeyboardComponent->setName (T("midiKeyboardComponent"));


    //[UserPreSize]
	addAndMakeVisible (edoControllerEditor);
    //[/UserPreSize]

    setSize (512, 512);

    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}

EdoControllerEditorWrapper::~EdoControllerEditorWrapper()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    //[/Destructor_pre]

    deleteAndZero (edoToolbar);
    deleteAndZero (midiKeyboardComponent);

    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void EdoControllerEditorWrapper::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void EdoControllerEditorWrapper::resized()
{
    edoToolbar->setBounds (0, 0, getWidth() - 0, 32);
    midiKeyboardComponent->setBounds (0, getHeight() - 96, getWidth() - 0, 96);
    //[UserResized] Add your own custom resize handling here..
	edoControllerEditor->setBounds (0, edoToolbar->getHeight(), getWidth(), getHeight() - midiKeyboardComponent->getHeight() - edoToolbar->getHeight());
    //[/UserResized]
}



//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void EdoControllerEditorWrapper::paintOverChildren (Graphics& g)
{
	GradientBrush gradient_1 (Colour (0x83000000),
                              (float) ((getWidth() / 2)), (float) (edoToolbar->getHeight()),
                              Colour (0x00000000),
                              (float) ((getWidth() / 2)), (float) (edoToolbar->getHeight()+6),
                              false);
    g.setBrush (&gradient_1);
    g.fillRect (0, edoToolbar->getHeight(), getWidth(), 6);
}
//[/MiscUserCode]


//==============================================================================
#if 0
/*  -- Jucer information section --

    This is where the Jucer puts all of its metadata, so don't change anything in here!

BEGIN_JUCER_METADATA

<JUCER_COMPONENT documentType="Component" className="EdoControllerEditorWrapper"
                 componentName="" parentClasses="public AudioProcessorEditor"
                 constructorParams="AudioProcessor *_edoController, EdoControllerEditor *_edoControllerEditor"
                 variableInitialisers="edoController(_edoController), AudioProcessorEditor(_edoController), edoControllerEditor(_edoControllerEditor)"
                 snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330000013"
                 fixedSize="1" initialWidth="512" initialHeight="512">
  <BACKGROUND backgroundColour="0"/>
  <JUCERCOMP name="" id="2f880ecb8e4dc712" memberName="edoToolbar" virtualName=""
             explicitFocusOrder="0" pos="0 0 0M 32" sourceFile="EdoToolbar/EdoToolbar.cpp"
             constructorParams=""/>
  <GENERICCOMPONENT name="midiKeyboardComponent" id="2b54bb8ecfdd09f7" memberName="midiKeyboardComponent"
                    virtualName="" explicitFocusOrder="0" pos="0 96R 0M 96" class="MidiKeyboardComponent"
                    params="midiKeyboardComponentState, MidiKeyboardComponent::horizontalKeyboard"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif
